module.exports = function (sequelize, DataTypes) {
    let tCrawlerRule = sequelize.define(
        't_crawler_rule', {
            config_id: {
                type: DataTypes.INTEGER(11),
                allowNull: false,
                autoIncrement: true,
                primaryKey: true
            },
            config_type: {
                type: DataTypes.INTEGER(11),
                allowNull: false
            },
            desc: {
                type: DataTypes.STRING,
                allowNull: true
            },
            url_pattern: {
                type: DataTypes.STRING,
                allowNull: true
            },
            load_image: {
                type: DataTypes.INTEGER(11),
                allowNull: false
            },
            image_pattern: {
                type: DataTypes.STRING,
                allowNull: true
            },
            phantomJs: {
                type: DataTypes.INTEGER(11),
                allowNull: true
            },
            query_js: {
                type: DataTypes.STRING,
                allowNull: true
            },
            css_navigation: {
                type: DataTypes.STRING,
                allowNull: true
            },
            page_num_limit: {
                type: DataTypes.INTEGER(11),
                allowNull: false
            },
            config_details: {
                type: DataTypes.STRING,
                allowNull: true
            },
            transfer_fields: {
                type: DataTypes.STRING,
                allowNull: true
            },
            storage_fields: {
                type: DataTypes.STRING,
                allowNull: true
            },
            refresh_freq: {
                type: DataTypes.STRING,
                allowNull: true
            },
            refresh_days: {
                type: DataTypes.INTEGER(11),
                allowNull: false
            },
            refresh_count: {
                type: DataTypes.INTEGER(11),
                allowNull: false
            },
            create_time: {
                type: DataTypes.DATE,
                allowNull: true
            },
            update_time: {
                type: DataTypes.DATE,
                allowNull: true
            },
            updator: {
                type: DataTypes.STRING,
                allowNull: true
            },
            addition_urls: {
                type: DataTypes.STRING,
                allowNull: true
            },
            use_proxy: {
                type: DataTypes.INTEGER(11),
                allowNull: false
            },
            encoding: {
                type: DataTypes.STRING,
                allowNull: true
            },
            cookie: {
                type: DataTypes.STRING,
                allowNull: true
            },
            useragent: {
                type: DataTypes.STRING,
                allowNull: true
            },
            interval: {
                type: DataTypes.INTEGER(11),
                allowNull: false
            },
            is_attach: {
                type: DataTypes.INTEGER(11),
                allowNull: false
            },
            /*
            INTEGER: {
                type: DataTypes.INTEGER(11),
                allowNull: false
            },
            DATE: {
                type: DataTypes.DATE,
                allowNull: true
            },
            STRING: {
                type: DataTypes.STRING,
                allowNull: true
            },
            */
        },
        {
            tableName: 't_crawler_rule',
            timestamps: false
        }
    );

    return tCrawlerRule;
};

